package j08baohan;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

class Cat{
    int age;

    public Cat(int age) {
        this.age = age;
    }

    @Override
    public boolean equals(Object obj) {
        Cat c = (Cat)obj;
        if(c.age != age)return false;
        return true;
    }
}

public class J1 {
    public static void main(String[] args) {
        List<Cat> l1 = new ArrayList<>(
                Arrays.asList(
                        new Cat(1),
                        new Cat(2)
                )
        );
        //? false
        System.out.println(l1.contains(new Cat(1)));
        System.out.println(l1.contains(new Cat(2)));
    }
}
